﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DoiMatKhau : System.Web.UI.Page
{
    khachhang kh = new khachhang();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kh"] != null)
            MultiView1.SetActiveView(View1);
        else Response.Redirect("DangNhap.aspx");
    }
    protected void btndoi_Click(object sender, EventArgs e)
    {
        try
        {        
            kh.doimatkhau(Session["kh"].ToString(), txtmkcu.Text, txtmkmoi.Text);
            MultiView1.SetActiveView(View2);
        }
        catch (Exception)
        {
            MultiView1.SetActiveView(View1);
            lblthongbao.Text = "Đổi mật khẩu thất bại ";
        }
    }
    protected void btnhuy_Click(object sender, EventArgs e)
    {
        Response.Redirect("DangNhap.aspx");
    }
}